Imports System

''' <summary>
''' Configuration class for the Crypto methods.
''' </summary>
Friend Class Config

#Region "Variables"

    Private Shared _Encoding As Text.Encoding = Text.Encoding.UTF8
    Private Shared _Hexa As Boolean
    Private Shared _Key As String = "Crypto00"
    Private Shared _IV() As Byte = {1, 3, 10, 55, 70, 90, 240, 2}
    Private Shared _AutoAdjustKeyLength As Boolean = True

#End Region

#Region "Properties"

    ''' <value>Encoding to be used for (de)encryption. Default is UTF8.</value>
    Public Shared Property Encoding() As Text.Encoding
        Get
            Return _Encoding
        End Get
        Set(ByVal value As Text.Encoding)
            _Encoding = value
        End Set
    End Property

    ''' <value>Will return and use hexadecimal values. Default is False.</value>
    Public Shared Property Hexa() As Boolean
        Get
            Return _Hexa
        End Get
        Set(ByVal value As Boolean)
            _Hexa = value
        End Set
    End Property

    ''' <value>Encryption key. Default is "Crypto00"</value>
    Public Shared Property Key() As String
        Get
            Return _Key
        End Get
        Set(ByVal value As String)
            _Key = value
        End Set
    End Property

    ''' <value>Initialization vector. Default is {1, 3, 10, 55, 70, 90, 240, 2}</value>
    Public Shared Property IV() As Byte()
        Get
            Return _IV
        End Get
        Set(ByVal value() As Byte)
            _IV = value
        End Set
    End Property

    ''' <value>Will auto adjust the key value if length is invalid. Defaut is True.</value>
    Public Shared Property AutoAdjustKeyLength() As Boolean
        Get
            Return _AutoAdjustKeyLength
        End Get
        Set(ByVal value As Boolean)
            _AutoAdjustKeyLength = value
        End Set
    End Property

#End Region

End Class